<!DOCTYPE html>
<html lang="cn">
<head>
    <meta charset="UTF-8">
    <title>Js</title>
    <style>
        button{
            width: 200px;
            height: 70px;
            color:#fff;
            background-color: #333;
            font-size:30px;
            border-radius: 30px;
        }
    </style>
</head>
<body>
    <h3>10S倒计时</h3>
    <hr>
    <button id="btn" disabled onclick="alert('已同意!')">同意(10)</button>


    <script>
        m = 10;// 初始值
        function showbtn(){
            var btn = document.getElementById('btn');
            if (m <= 0) {
                btn.disabled = false;
                btn.innerHTML = '同意';
                return;
            }
            btn.innerHTML = '同意('+m+')';
            m--;
            setTimeout('showbtn()',500);
        }
        showbtn();
    </script>
</body>
</html>